package P6.T03;

import javax.swing.*;
import java.awt.*;

public class JMyFrame extends JFrame {
    private JButton btn=new JButton("画线");
    public JMyFrame() {

        this.setTitle("画几条线");
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setSize(500, 500);
        this.setLocationRelativeTo(null);
        JPanel panel=new JMyPanel();
        add(panel,BorderLayout.CENTER);
        btn.addActionListener(new DrawAction(this));

        add(btn, BorderLayout.SOUTH);
        this.setVisible(true);
    }
}
